/*
Y.prototype.destroy = Y.prototype.B;
Y.prototype.setLogCallback = Y.prototype.U;
Y.prototype.getAttemptID = Y.prototype.R;
Y.prototype.getBuffer = Y.prototype.S;
Y.prototype.clientConnect = Y.prototype.F;
Y.prototype.clientGetStatus = Y.prototype.K;
Y.prototype.clientGetSelf = Y.prototype.J;
Y.prototype.clientGetHostMode = Y.prototype.H;
Y.prototype.clientGetGuests = Y.prototype.G;
Y.prototype.clientDisconnect = Y.prototype.C;
Y.prototype.clientSendUserData = Y.prototype.O;
Y.prototype.clientSendMessage = Y.prototype.N;
Y.prototype.clientPollEvents = Y.prototype.M;
Y.prototype.clientGetMetrics = Y.prototype.I;
Y.prototype.clientNetworkFailure = Y.prototype.L;
Y.prototype.Status = K;
*/

window.init = function () {
    const video = document.querySelector('video'); // A <video> element
    const audio = document.querySelector('audio'); // An <audio> element
    const container = document.querySelector('#container'); // Top level wrapper element (optional)
    window.parsec = new window.Parsec(video, audio, container);
}

/**
 * @param {*} sessionId 会话id
 * @param {*} peerId  peerid
 */
window.clientConnect = function (sessionId, peerId) {
    window.parsec.clientConnect(sessionId, peerId, '')
}

/**
 * @param {*} message 消息
 */
window.clientSendMessage = function (message) {
    window.parsec.clientSendMessage(JSON.parse(message))
}

/**
 * 获取状态
 */
window.clientGetStatus = function () {
    return window.parsec.clientGetStatus()
}

/**
 * 断开连接
 */
window.clientDisconnect = function () {
    window.parsec.clientDisconnect()
}


/**
 * 轮询事件
 */
window.clientPollEvents = function () {
    return window.parsec.clientPollEvents()
}

/**
 * 销毁
 */
window.destroy = function () {
    window.parsec.destroy()
}

window.destroy = function () {
    parsec.destroy();
}





